<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="/common/common.jsp"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2-metronic.css"/>
</head>
<body class="page-header-fixed">
<jsp:include page="/common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
    <div class="page-sidebar-wrapper"><jsp:include page="/common/menu.jsp"/></div>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet box purple">
                    
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-file-text-o"></i> 数据列表 
                            </div>
                            <div class="tools">
                                <div class="actions">
                                    <a href="${path}/emailRecord/edit" class="btn green"><i class="fa fa-plus"> 新增</i></a>
                                </div>
                            </div>
                        </div>
                        
                        <div class="portlet-body">
                            <form id="formQuery" class="form-horizontal" action="${path}/emailRecord/list">
                                <div class="form-body">
                                    
                                    <div class="form-group">
                                         <label class="col-md-1 control-label">ip</label>
                                        <div class="col-md-2">
                                            <input type="text" id="user_ip" name="user_ip" class="form-control"/>
                                        </div>  
                                        <label class="col-md-1 control-label">email标题</label>
                                        <div class="col-md-2">
                                            <input type="text" id="email_title" name="email_title" class="form-control"/>
                                        </div>  
                                        <label class="col-md-1 control-label">src内容</label>
                                        <div class="col-md-2">
                                            <input type="text" id="src_account" name="src_account" class="form-control"/>
                                        </div> 
                              </div>   
                              
                               <div class="form-group">
                                        <label class="col-md-1 control-label">发布时间</label>
                                        <div class="col-md-4">
                                            <div class="input-group input-large date-picker input-daterange"
                                                 data-date-format="yyyy-mm-dd">
                                                <input type="text" class="form-control" id="fromDate" name="createTime" value="${entity.createTime.split(",")[0]}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                                <span class="input-group-addon">to</span>
                                                <input type="text" class="form-control" id="toDate" name="createTime" value="${entity.createTime.split(",")[1]}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                            </div>
                                        </div>
                                        <label class="col-md-1 control-label">状态</label>
                                        <div class="col-md-2">
                                            <select id="status" name="status" class="form-control">
                                                <option value="">所有</option>
                                                <option value="0">未审核</option>
                                                <option value="1">审核通过</option>
                                                <option value="2">审核未通过</option>
                                               
                                            </select>
                                        </div>
                                
                                       	<div class="col-md-1">
                                            <button type="button" class="btn green" onclick="getemailRecordList()">查询</button>      <!-- e 查询直接调用getNewsList() 在本末的script中-->
                                       	 </div>                                                                                                                                           
                               		</div>   
                       
                                </div>
                            </form>
                        </div>
                        
                    </div>
                </div>
            </div>
            
              			  <div id="container" style="min-width:700px;height:400px"></div>
        </div>
    </div>
</div>
<jsp:include page="/common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/district/linkagesel-min.js"></script>
<script type="text/javascript" src="${path}/audit/emailRecord/js/emailRecord.js"></script>         
<script src="${path}/assets/plugins/ueditor/third-party/highcharts/highcharts.js"></script>
<script src="${path}/assets/plugins/ueditor/third-party/highcharts/modules/exporting.js"></script>
<script type="text/javascript" >
$(function () {
                var chart;
                $(document).ready(function() {
                    chart = new Highcharts.Chart({
                        //常规图表选项设置
                        chart: {
                            renderTo: 'container',        //在哪个区域呈现，对应HTML中的一个元素ID
                            plotBackgroundColor: null,    //绘图区的背景颜色
                            plotBorderWidth: null,        //绘图区边框宽度
                            plotShadow: false            //绘图区是否显示阴影            
                        },
                        
                        //图表的主标题
                        title: {
                            text: '按ip点击统计量'
                        },
                        //当鼠标经过时的提示设置
                        tooltip: {
                            pointFormat: '{series.name}: <b>{point.percentage}%</b>',
                            percentageDecimals: 1
                        },
                        //每种图表类型属性设置
                        plotOptions: {
                            //饼状图
                            pie: {
                                allowPointSelect: true,
                                cursor: 'pointer',
                                dataLabels: {
                                    enabled: true,
                                    color: '#000000',
                                    connectorColor: '#000000',
                                    formatter: function() {
                                        //Highcharts.numberFormat(this.percentage,2)格式化数字，保留2位精度
                                        return '<b>'+ this.point.name +'</b>: '+Highcharts.numberFormat(this.percentage,2) +' %';
                                    }
                                }
                            }
                        },
                           //图表要展现的数据
                        series: [{
                            type: 'pie',
                            name: '份额'
                        }]
                    });
         });
    //异步请求数据
    $.ajax({
        type:"GET",
  	 	url:'${path}/emailRecord/emailRecordCount',//提供数据的Servlet
        success:function(data){
            //定义一个数组
            browsers = [],
            //迭代，把异步获取的数据放到数组中
            $.each(data.classList,function(i,d){
                browsers.push([d.user_ip,d.total]);
            });
            //设置数据
            chart.series[0].setData(browsers);  
        },
        error:function(e){
            alert(e);
        }
    });
});			



</script>
</body>
</html>